<include target="_tool_header.html" />
<load target="css/form.css" />

<!-- Content -->
<div id="content">
    <!-- contentHeader -->
    <div class="contentHeader categoryHeader">
        <h3 class="h3">Edit skin</h3>
    </div>
    <!-- /contentHeader -->

    <div id="skin_settings">
        <div cond="$XE_VALIDATOR_MESSAGE" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
            <p>{$XE_VALIDATOR_MESSAGE}</p>
        </div>

        <form action="./" method="post" enctype="multipart/form-data" class="form">
            <input type="hidden" name="module" value="module" />
            <input type="hidden" name="vid" value="{$vid}" />
            <input type="hidden" name="mid" value="{$mid}" />
            <input type="hidden" name="act" value="procModuleAdminUpdateSkinInfo" />
            <input type="hidden" name="_mode" value="{$mode}" />
            <input type="hidden" name="module_srl" value="{$module_info->module_srl}" />
            <input type="hidden" name="page" value="{$page}" />

            <h2 class="h2">{$lang->skin_default_info}</h2>

            <ul>
                <li>
                    <p class="q">{$lang->skin}</p>
                    <p class="a">{$skin_info->title}</p>
                </li>
                <li>
                    <p class="q">{$lang->skin_author}</p>
                    <p class="a">
                        <block loop="$skin_info->author=>$author">
                            {$author->name}
                            <block cond="$author->homepage || $author->email_address">
                                (<a href="{$author->homepage}" onclick="window.open(this.href);return false;" cond="$author->homepage">{$author->homepage}</a>
                                <block cond="$author->homepage && $author->email_address">, </block>
                                <a href="mailto:{$author->email_address}" cond="$author->email_address">{$author->email_address}</a>)
                            </block><br />
                        </block>
                    </p>
                </li>
                <li cond="$skin_info->homepage">
                    <p class="q">{$lang->homepage}</p>
                    <p class="a"><a href="{$skin_info->homepage}" onclick="window.open(this.href);return false;">{$skin_info->homepage}</a></p>
                </li>
                <li>
                    <p class="q">{$lang->date}</p>
                    <p class="a">{zdate($skin_info->date, 'Y-m-d')}</p>
                </li>
                <li cond="$skin_info->license || $skin_info->license_link">
                    <p class="q">{$lang->skin_license}</p>
                    <p class="a">{nl2br(trim($skin_info->license))}</p>
                    <p cond="$skin_info->license_link"><a href="{$skin_info->license_link}" onclick="window.close(); return false;">{$skin_info->license_link}</a></p>
                </li>
                <li cond="$skin_info->description">
                    <p class="q">{$lang->description}</p>
                    <p class="a">{nl2br(trim($skin_info->description))}</p>
                </li>
            </ul>

            <h2 class="h2">{$lang->extra_vars}</h2>
            <ul>
                <li cond="$skin_info->colorset" class="colorset">
                    <p class="q">{$lang->colorset}</p>
                    <div class="a">
                        <block loop="$skin_info->colorset => $key, $val">
                            <!--@if($val->screenshot)-->
                            {@ $_img_info = getImageSize($val->screenshot); $_height = $_img_info[1]+40; $_width = $_img_info[0]+20; $_talign = "center"; }
                            <!--@else-->
                            {@ $_width = 200; $_height = 20; $_talign = "left"; }
                            <!--@end-->
                            <div style="display:inline-block;text-align:{$_talign};margin-bottom:1em;width:{$_width}px;height:{$_height}px;margin-right:10px;">
                                <input type="radio" name="colorset" value="{$val->name}" id="colorset_{$key}" checked="checked"|cond="$skin_vars['colorset']->value==$val->name" />
                                <label for="colorset_{$key}">{$val->title}</label>
                                <block cond="$val->screenshot">
                                    <br />
                                    <img src="../../../{$val->screenshot}" alt="{$val->title}" style="border:1px solid #888888;padding:2px;margin:2px;"/>
                                </block>
                            </div>
                        </block>
                    </div>
                </li>
                <block loop="$skin_info->extra_vars => $key, $val">
                    <block cond="$val->group && ((!$group) || $group != $val->group)">
                        {@$group = $val->group}
            </ul>
            <h2 class="h2">{$group}</h2>
            <ul>
                </block>
                <li>
                    <p class="q">{$val->title}</p>
                    <p cond="$val->type == 'text'" >
                        {ShopDisplay::multiLanguageInput($val->name, $val->title, $val->value, 'width:517px', 'iText', $val->description, 'iLabel', 'fItem')}
                    </p>
                    <div cond="$val->type == 'textarea'" >
                        {ShopDisplay::multiLanguageTextarea($val->name, $val->title, $val->value, 'width:517px', 'iText', $val->description, 'iLabel', 'fItem',8, 20)}
                    </div>
                    <p cond="$val->type == 'select'" class="a">
                        <select name="{$val->name}">
                            <option loop="$val->options => $k, $v" value="{$v->value}" selected="selected"|cond="$v->value == $val->value">{$v->title}</option>
                        </select>
                    </p>
                    <p cond="$val->type == 'checkbox'" class="a">
					<span loop="$val->options => $k, $v">
						<input type="checkbox" name="{$val->name}[]" value="{$v->value}" id="ch_{$key}_{$k}" checked="checked"|cond="@in_array($v->value, $val->value)" class="checkbox" />
						<label for="ch_{$key}_{$k}">{$v->title}</label>
					</span>
                    </p>
                    <p cond="$val->type == 'radio'" class="a">
					<span loop="$val->options => $k, $v">
						<input type="radio" name="{$val->name}" value="{$v->value}" id="ch_{$key}_{$k}" checked="checked"|cond="$v->value==$val->value" />
						<label for="ch_{$key}_{$k}">{$v->title}</label>
					</span>
                    </p>
                    <div cond="$val->type == 'image'" class="a">
                        <div cond="$val->value">
                            <img src="{$val->value}" /><br />
                            <input type="checkbox" name="del_{$val->name}" value="Y" id="del_{$val->name}" class="checkbox" />
                            <label for="del_{$val->name}">{$lang->cmd_delete}</label>
                        </div>

                        <input type="file" name="{$val->name}" value="" />
                    </div>

                    <p cond="$val->description" class="desc">{nl2br(trim($val->description))}</p>
                </li>
                </block>
            </ul>
            <div class="btnArea">
                <span class="btn"><input type="submit" value="{$lang->cmd_registration}" /></span>
            </div>
        </form>
        <include target="_multilingual.html" />
    </div>
</div>
<!-- /Content -->

<include target="_tool_menu.html" />
<include target="_tool_footer.html" />